
// import { asyncMenu } from '@/api/api.js'
import { defineStore } from 'pinia'
import router from '@/router/index'
import { ref } from 'vue'
import { useUserStore } from '@/pinia/modules/user'
// import Cookies from 'js-cookie'

export const useRouterStore = defineStore(
  'router',
  () => {
    const asyncRouters = ref({
      allRoutes: [],
      leftRoutes: [],
      leftMenus:[]
    })
  
    

    return {
      asyncRouters,
     
    }
  },
  // 数据持久化
  {
    persist: {
      enabled: false,
      strategies: [
        { storage: sessionStorage, paths: ['asyncRouters'], key: 'asyncRouters' }
      ]
    }
  }
)
